package com.liuweiheng.cloudproviderpayment8002.common.controller;

import com.liuweiheng.base.entity.R;
import com.liuweiheng.cloudproviderpayment8002.common.service.UserService;
import com.liuweiheng.cloudproviderpayment8002.entity.User;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 控制器：用户服务接口
 *
 * @author lwh
 */
@RestController
@RequestMapping("/payment/user")
public class UserController {

    /**
     * 服务接口：用户服务
     */
    @Autowired
    private UserService userService;

    /**
     * 创建用户
     * @param user 用户信息
     * @return R
     */
    @ApiOperation("创建用户")
    @PostMapping("/create")
    //@RequiresPermissions({"user:create:*"})
    public R create(@RequestBody User user) {
        Integer createId = userService.createUser(user);
        return R.ok("创建用户成功，用户编号：" + createId);
    }



}
